package com.mzy.xmyx.sys.controller;


import com.mzy.xmyx.common.result.Result;
import com.mzy.xmyx.model.sys.Region;
import com.mzy.xmyx.sys.service.RegionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 地区表 前端控制器
 * </p>
 *
 * @author mzy
 * @since 2023-11-29
 */
@Api(tags = "区域管理")
@RestController
@RequestMapping("/admin/sys/region")
@CrossOrigin
public class RegionController {


    @Autowired
    private RegionService regionService;

    @ApiOperation("根据区域名查询区域信息")
    @GetMapping("/findRegionByKeyword/{keyword}")
    public Result findRegionByKeyword(@PathVariable String keyword) {
        List<Region> regionList = regionService.findRegionByKeyword(keyword);
        return Result.ok(regionList);
    }

}

